<!DOCTYPE html>
<html>
<head>
  <title></title>
</head>
<body>
  <button class="send">send</button>
</body>
<script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
<script src="http://lib.baomitu.com/socket.io/2.0.1/socket.io.js"></script>
<script type="text/javascript">
  var socket = io('ws://socket.58zltc.com');

  $('.send').on('click', function(evt) {
    // var username = $.trim($('.usernameInput').val());
    socket.emit('addUser', "罗辉伟");
  });

  socket.on('opend', function(data) {
    console.log('opend:', data);
  });

  socket.on('joined', function(data) {
    console.log('joined:', data);
  });
</script>
</html>